<?php

extract(extractPost(), EXTR_PREFIX_ALL, 'u');

if(isset($u_user_id)){
    
    $user = R::load( 'user', $u_user_id);
    
    if(!$user->id){
        jsonErrorDie("User with id = $u_user_id does not exist.");
    }
    
    $user->active = !$user->active;
    R::store($user);
    jsonSuccessDie("user_id", $u_user_id);
    
}
else{
    jsonErrorDie("Parameter user_id not passed.");
}